<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>鉴宝</title>
		<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes"/>
		<meta name="format-detection" content="telephone=no"  />
		<meta http-equiv="X-UA-Compatible" content="IE=Edge，chrome=1">
		<link rel="stylesheet" href="../addons/ewei_shopping/images/css/style.css" />
        <script type="text/javascript" src="../addons/ewei_shopping/images/jquery-1.8.3.js"></script>
		<script type="text/javascript" src="../addons/ewei_shopping/images/js/all.js" ></script>
        <script language="javascript" src="../addons/ewei_shopping/images/touchslider.min.js"></script>
        <script language="javascript" src="../addons/ewei_shopping/images/swipe.js"></script>
	</head>
	<body>
		<div class="wapper">
			<header>
				<div class="goback"><a href="#" onClick="javascript :history.back(-1);"><img src="../addons/ewei_shopping/images/img/back.png" /> <span>返回</span></a></div>
				<div class="midtit">微信在线鉴宝</div>
				<div class="morshar"><a href="">...</a></div>
			</header>
			
			<section class="smal_ban">
				<div class="new_bit"><img src="../addons/ewei_shopping/images/img/newtt.png" /></div>
			</section>
			<section>
				<div class="newlist">
					<ul id="zailist">
                    {loop $news $new}
						<a href="{php echo $this->createMobileUrl('antiquenews',array('id'=>$new['id']))}">
                        <li>
							<div class="newle"><img src="../attachment/{$new['image']}" /></div>
							<div class="newrg">
								<div class="tit">
									<div class="tit_le">
                                        <?php $len = strlen($new['title'])/3; echo mb_substr($new['title'],0,10,'utf-8');if($len >10){echo "...";} ?>
                                    </div>
									<div class="tit_rg"><?php echo date('Y-m-d',$new['createtime']); ?></div>
								</div>
								<div class="trr">
                                    <?php $lens = strlen($new['content'])/3; echo mb_substr($new['content'],0,48,'utf-8');if($lens >30){echo "...";} ?>
                                </div>
							</div>
						</li></a>
                    {/loop}
					</ul>
                    <div id="pager" style="font-size:10px;font-color:#ddd;text-align:center;height:20px" ></div>
				</div>
			</section>
			
			<footer>
				<ul>
					<li><a href="">
						<p class="icoimg"><img src="../addons/ewei_shopping/images/img/home.png"  /></p>
						<p>首页</p>
					</a>
					</li>
					<li><a href="">
						<p class="icoimg"><img src="../addons/ewei_shopping/images/img/zj.png" /></p>
						<p>专家</p>
						</a>
					</li>
					<li><a href="">
						<p class="icoimg"><img src="../addons/ewei_shopping/images/img/yyclass.png" /></p>
						<p>语音课堂</p>
						</a>
					</li>
				</ul>
			</footer>
		</div>
<input type="hidden" pindex="2" id="pager"/>
<script>
function loadPage(cur_page,page_size) {
	var pindex = cur_page;
    $('#pager').html('正在加载数据...');
	$.post(location.href, {'page' : pindex}, function(data){
    console.log(data);
    
        var jsondata = jQuery.parseJSON(data); 
        var li_clone =  "";
 //图片调用：<img src="'+item.newthumb+'" />
        $.each(jsondata, function(i, item) {
            
            li_clone += "<a href="+item.url+">"
            li_clone += ' <li>'
            li_clone += '<div class="newle"><img src="../attachment/'+item.image+'" /></div>'
            li_clone += '<div class="newrg">'
            li_clone += '<div class="tit">'
            li_clone += '<div class="tit_le">'+item.title+'</div>'
            li_clone += '<div class="tit_rg">'+item.createtime+'</div>'
            li_clone += '</div>'
            li_clone += '<div class="trr">'+item.content+'</div>'	
            li_clone += '</div>'	
            li_clone += '</li>'		
            li_clone += "</a>"
        });
		$('#zailist').append(li_clone);
        $('#pager').html("");
	});
}

$(function(){
    var cur_page = 1;
    var page_size = 5;
    $(window).scroll(function(){
        var scrollTop = $(window).scrollTop();
        var owinH=$(window).height();
        var odocH = $(document).height();
        if(scrollTop + owinH+30 >= odocH){
            //console.log("这里是滚到底部的处理分页，这里需要你请求后台的数据！！")
            ++cur_page;
            loadPage( cur_page,page_size);
        }
         
    });
})
</script>
	</body>
</html>
